package elsa.tools;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

public class GroupMess {
    public JSONArray persons;
    public Person person;

    public static GroupMess reder(String name1,String id1,String name2,String id2,String name3,String id3,String name4,String id4,String name5,String id5){
        GroupMess groupMess = new GroupMess();
        Person person1 = new Person();
        person1.name = name1;
        person1.id = id1;
        Person person2 = new Person();
        person2.name = name2;
        person2.id = id2;
        Person person3 = new Person();
        person3.name = name3;
        person3.id = id3;
        Person person4 = new Person();
        person4.name = name4;
        person4.id = id4;
        Person person5 = new Person();
        person5.name = name5;
        person5.id = id5;
        groupMess.persons = new JSONArray();
        groupMess.persons.add(JSONObject.parse(person1.toString()));
        groupMess.persons.add(JSONObject.parse(person2.toString()));
        groupMess.persons.add(JSONObject.parse(person3.toString()));
        groupMess.persons.add(JSONObject.parse(person4.toString()));
        groupMess.persons.add(JSONObject.parse(person5.toString()));
        return groupMess;
    }

    static class Person{
        private String name;
        private String id;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        @Override
        public String toString() {
            return "{'name':'" + name + "','id':'" + id + "'}";
        }
    }
}
